package com.bjpowernode.app;
import com.bjpowernode.beans.Stu;
import java.util.InputMismatchException;
import java.util.Scanner;
//前端界面给的数据类型只有字符串
//控制器会根据业务的需求转换字符串到相应的数据类型
//控制器负责数据类型是否正确
//业务接收到参数后，需要对参数进行范围等等一些和业务相关的数据值判定
//控制器判定数据类型
//业务判定数据内容
public class MyApp13 {
    public static void main(String[] args)  {
        Scanner scanner = new Scanner(System.in);
        String name = scanner.next();
        float score = 0;
        try {
            score = scanner.nextFloat();
        } catch (InputMismatchException e) {
            System.out.println("你输入必须输入数字");
            return;
        }
        MyStuServices stuServices = new MyStuServices();
        Stu result = null;
        try {
            result = stuServices.add(name, score);
        } catch (MyException e) {
            System.out.println(e.getMessage());
        }
        System.out.println(result);
    }

}
